import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/home',
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('@/views/home.vue'),
      redirect: '/data-overview',
      children: [
        {
          path: '/data-overview',
          name: '数据概览',
          component: () => import('@/views/DataOverview.vue'),
        },
        {
          path: '/candidate-management',
          name: '候选人管理',
          component: () => import('@/views/CandidateManagement.vue'),
        },
        {
          path: '/topic-classification-management',
          name: '题目分类管理',
          component: () => import('@/views/topic/TopicClassificationManagement.vue'),
        },
        {
          path: '/topics-management',
          name: '题目集管理',
          component: () => import('@/views/topic/TopicsManagement.vue'),
        },
        {
          path: '/topic-management',
          name: '题目管理',
          component: () => import('@/views/topic/TopicManagement.vue'),
        },
        {
          path: '/interview-record',
          name: '面试记录',
          component: () => import('@/views/InterviewRecord.vue'),
        },
        {
          path: '/position-management',
          name: '职位管理',
          component: () => import('@/views/PositionManagement.vue'),
        },
        {
          path: '/interviewer-management',
          name: '面试官管理',
          component: () => import('@/views/InterviewerManagement.vue'),
        },
        {
          path: '/system-settings',
          name: '系统设置',
          component: () => import('@/views/SystemSettings.vue'),
        },
      ],
    },
  ],
})

export default router
